package a.f.n;

import a.c.d;
import a.c.e;
import a.c.j;
import a.c.m;
import a.d.f;
import a.d.w;
import a.f.cd;
import a.f.o;
import a.f.zc;
import a.i.p;

import java.util.Comparator;

public class s
  extends k
{
  private boolean o = true;
  private double p = 20.0D;
  private double q = 20.0D;
  public static final Object r = "y.layout.tree.LeftRightPlacer.LEFT_RIGHT_DPKEY";
  public static boolean s;
  
  public s()
  {
    this(k.b_.a);
  }
  
  public s(k.b_ paramb_)
  {
    super(paramb_);
  }
  
  public double e()
  {
    return this.p;
  }
  
  public void b(double paramDouble)
  {
    this.p = paramDouble;
  }
  
  public double f()
  {
    return this.q;
  }
  
  public void c(double paramDouble)
  {
    this.q = paramDouble;
  }
  
  public void a(double paramDouble)
  {
    super.a(paramDouble);
    b(paramDouble);
    c(paramDouble);
  }
  
  public void a(e parame, j paramj)
  {
    boolean bool3 = k.n;
    boolean bool2 = k.m;
    this.h = ((o)parame.g());
    try
    {
      int i = parame.e() - 1;
      int j = 0;
      boolean bool1 = true;
      a.c.k localk = this.h.c(r);
      d locald = parame.h();
      label128:
      label152:
      label154:
      do
      {
        if (locald == null) {
          break;
        }
        e locale = locald.f();
        if (bool2) {
          return;
        }
        if ((bool3) || (localk != null)) {
          bool1 = localk.getBool(locale);
        }
        if (!bool3) {
          if (this.o)
          {
            if (bool3) {
              break label128;
            }
            if (j == i)
            {
              b = 0;
              if (bool3) {
                break label154;
              }
              if (!bool2) {
                break label152;
              }
            }
          }
        }
        if (!bool3) {
          if (bool1)
          {
            b = 1;
            if (bool3) {
              break label154;
            }
            if (!bool2) {
              break label152;
            }
          }
        }
        byte b = 3;
        if (!bool3) {}
        bool1 = !bool1;
        paramj.a(locale, a(b));
        j++;
        locald = locald.i();
      } while (!bool2);
      if (bool3) {}
    }
    finally
    {
      this.h = null;
    }
  }
  
  protected byte d(e parame)
  {
    throw new IllegalStateException("Should not be called");
  }
  
  protected v a(e parame, byte paramByte)
  {
    boolean bool3 = k.n;
    boolean bool2 = k.m;
    v localv1 = a(parame);
    v localv2 = a(parame);
    if (!bool3) {
      if (parame.e() == 0)
      {
        a(parame, paramByte, localv1);
        return localv2;
      }
    }
    d locald1 = parame.h();
    if (locald1 == null) {
      return localv1;
    }
    a.c.k localk = this.h.c(r);
    double d1 = (-1.0D / 0.0D);
    double d2 = (1.0D / 0.0D);
    double d3 = (1.0D / 0.0D);
    double d4 = (-1.0D / 0.0D);
    Object localObject1 = locald1;
    do
    {
      if (localObject1 == null) {
        break;
      }
      localObject2 = a((d)localObject1);
      if (!bool3) {
        if (d2 < ((w)localObject2).b()) {
          d2 = ((w)localObject2).b();
        }
      }
      if (!bool3) {
        if (d3 > ((w)localObject2).a()) {
          d3 = ((w)localObject2).a();
        }
      }
      if (!bool3)
      {
        if (d4 < ((w)localObject2).a()) {
          d4 = ((w)localObject2).a();
        }
        localObject1 = ((d)localObject1).i();
      }
    } while (!bool2);
    localObject1 = new f(-1.797693134862316E+308D, 1.7976931348623157E+308D, localv2.d());
    Object localObject2 = new f(-1.797693134862316E+308D, 1.7976931348623157E+308D, localv2.d());
    f localf1 = new f(-1.797693134862316E+308D, 1.7976931348623157E+308D, d3);
    f localf2 = new f(-1.797693134862316E+308D, 1.7976931348623157E+308D, d4);
    boolean bool1 = true;
    int i = parame.e() - 1;
    int j = 0;
    m localm = parame.n();
    label463:
    label626:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald2 = localm.a();
      e locale = locald2.f();
      if (bool2) {
        return localv1;
      }
      if ((bool3) || (localk != null)) {
        bool1 = localk.getBool(locale);
      }
      v localv3 = b(locale);
      if (!bool3) {
        if (this.o)
        {
          if (bool3) {
            break label463;
          }
          if (j == i)
          {
            double d5 = a(locald2).a() - localv3.b();
            localv3.k(d5);
            double d6 = localv3.a(0, (f)localObject1);
            double d7 = localv3.a(0, (f)localObject2);
            double d8 = Math.min(d6, d7) - this.q;
            localv3.g(d8);
            db.a_ locala_2 = a(locald2, localv3);
            localv3.l();
            locala_2.e();
            if (bool3) {
              continue;
            }
            if (!bool2) {
              break label626;
            }
          }
        }
      }
      db.a_ locala_1;
      if (bool1)
      {
        localv3.b(localf1, this.p);
        locala_1 = a(locald2, localv3);
        locala_1.d(0);
        localv3.l();
        localv3.e((f)localObject1, this.q);
        locala_1.e();
        localv3.f((f)localObject1);
        if (!bool3) {}
        bool1 = !bool1;
        if (bool3) {
          continue;
        }
        if (!bool2) {}
      }
      else
      {
        localv3.d(localf2, this.p);
        locala_1 = a(locald2, localv3);
        locala_1.e(0);
        localv3.l();
        localv3.e((f)localObject2, this.q);
        locala_1.e();
        localv3.f((f)localObject2);
        if (!bool3) {}
        bool1 = !bool1;
      }
      d1 = Math.max(d1, localv3.c());
      localv1.a(localv3);
      j++;
      localm.f();
    } while (!bool2);
    localv1.b(d3, d2, d4 - d3, d1 - d2);
    if (!bool3) {
      a(parame, paramByte, localv1);
    }
    return localv1;
  }
  
  private void a(e parame, byte paramByte, v paramv)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (parame.i() == null) {
      return;
    }
    cd localcd = c(parame);
    db.b_ localb_ = a(parame, paramv);
    if (!bool2)
    {
      switch (paramByte)
      {
      case 0: 
        if (!bool2)
        {
          switch (localcd.b())
          {
          case 1: 
          case 3: 
          case 5: 
          case 6: 
          case 7: 
          default: 
            if (!bool2) {
              if (!bool1) {
                break label573;
              }
            }
          case 4: 
            localb_.b(0, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break label573;
            }
          case 2: 
            localb_.e(0, true);
            localb_.b(0, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break label573;
            }
          }
          localb_.c(0, true);
          if (bool2) {
            return;
          }
        }
        if (!bool1) {
          break;
        }
      case 1: 
        if (!bool2)
        {
          switch (localcd.b())
          {
          case 1: 
            localb_.d(0, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break label573;
            }
          case 3: 
          case 4: 
          case 5: 
          case 6: 
          case 7: 
          default: 
            if (!bool2) {
              if (!bool1) {
                break label573;
              }
            }
          case 2: 
            localb_.e(0, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break label573;
            }
          }
          localb_.c(0, true);
          localb_.d(1, true);
          if (bool2) {
            return;
          }
        }
        if (!bool1) {
          break;
        }
      case 2: 
        if (!bool2) {
          switch (localcd.b())
          {
          case 1: 
            localb_.d(0, true);
            localb_.c(1, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break;
            }
          case 3: 
          case 4: 
          case 5: 
          case 6: 
          case 7: 
          default: 
            localb_.b(1, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break;
            }
          case 2: 
            localb_.e(0, true);
            localb_.b(1, true);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break;
            }
          case 8: 
            localb_.c(1, true);
            if (bool2) {
              return;
            }
            break;
          }
        } else {
          if (!bool1) {
            break;
          }
        }
        break;
      case 3: 
        if (!bool2) {}
        switch (localcd.b())
        {
        case 1: 
          localb_.d(0, true);
          if (bool2) {
            return;
          }
          if (!bool1) {
            break;
          }
        case 4: 
          localb_.b(0, true);
          localb_.d(0, true);
          if (bool2) {
            return;
          }
          if (!bool1) {
            break;
          }
        case 2: 
          localb_.e(0, true);
          if (bool2) {
            return;
          }
          if (bool1) {
            break;
          }
        }
        break;
      }
      label573:
      paramv.l();
    }
  }
  
  public boolean g()
  {
    return this.o;
  }
  
  public void a(boolean paramBoolean)
  {
    this.o = paramBoolean;
  }
  
  public Comparator c()
  {
    new Comparator()
    {
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        boolean bool = k.n;
        e locale1 = ((d)paramAnonymousObject1).f();
        e locale2 = ((d)paramAnonymousObject2).f();
        o localo = (o)locale1.g();
        w localw = new w(localo.m(locale2) - localo.m(locale1), localo.n(locale2) - localo.n(locale1));
        localw = k.a(s.this.i, localw);
        if (!bool) {
          if (localw.b() == 0.0D) {
            return 0;
          }
        }
        if (!bool) {}
        return localw.b() > 0.0D ? -1 : 1;
      }
    };
  }
  
  public static final class b_
    extends p
  {
    private a.c.k c;
    public static boolean d;
    
    public b_(a.c.k paramk)
    {
      this.c = paramk;
    }
    
    public boolean getBool(Object paramObject)
    {
      boolean bool = k.n;
      e locale1 = (e)paramObject;
      e locale2 = locale1.i().e();
      o localo = (o)locale1.g();
      zc localzc1 = localo.d(locale1);
      zc localzc2 = localo.d(locale2);
      w localw = new w(localzc2.a() - localzc1.a(), localzc2.b() - localzc1.b());
      Object localObject = this.c.get(locale2);
      if (!bool) {
        if ((localObject instanceof k))
        {
          k localk = (k)localObject;
          localw = k.a(localk.b(), localw);
          if (!bool) {}
          return localw.a() > 0.0D;
        }
      }
      return false;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.n.s

 * JD-Core Version:    0.7.0.1

 */